#ifndef SCHEDULER_GENERATOR_H
#define SCHEDULER_GENERATOR_H

#include <optional>
#include <global.h>
#include "scheduler/abstract_scheduler.h"
#include "scripting/script_header.h"
#include "scripting/script_task_object_pool.h"

namespace script
{

using SchedulerOptional = std::optional<scheduler::AbstractSchedulerConstPtr>;

class SchedulerGeneratorData;
/**
 * @brief:  scheduler生成器，用在脚本解析中，根据语句生成对应的scheduler
 * @author: sherlock_lht
 */
class SchedulerGenerator
{
public:
    explicit SchedulerGenerator(const std::shared_ptr<ScriptTaskObjectPool> &task_pool);
    virtual ~SchedulerGenerator();

    SchedulerOptional generateExpressionScheduler(const ASTNode &ast_node);

private:
    DECLARE_DATA(SchedulerGenerator)
};

}

#endif //SCHEDULER_GENERATOR_H
